Skip to main content

libobs_simple\sources\windows\sources/
capture.rs

1use num_derive::{FromPrimitive, ToPrimitive};
2
3#[repr(i32)]
4#[derive(Clone, Copy, Debug, PartialEq, Eq, FromPrimitive, ToPrimitive)]
5/// Describes the priority of the window capture source.
6/// Used in `WindowCaptureSourceBuilder`
7pub enum ObsWindowPriority {
8    /// The window class names must be the same. This means that windows are of the same type.
9    Class = libobs::window_priority_WINDOW_PRIORITY_CLASS,
10    /// Window titles must match otherwise, find window with the same class
11    Title = libobs::window_priority_WINDOW_PRIORITY_TITLE,
12    /// Match title, otherwise find window with the same executable
13    Executable = libobs::window_priority_WINDOW_PRIORITY_EXE,
14}
15
16#[repr(i32)]
17#[derive(Clone, Copy, Debug, PartialEq, Eq, FromPrimitive, ToPrimitive)]
18/// Describes the capture method of the window capture source.
19/// Used in `WindowCaptureSourceBuilder`
20pub enum ObsWindowCaptureMethod {
21    /// Automatically selects the best method based on the window.
22    MethodAuto = libobs::window_capture_method_METHOD_AUTO,
23    /// Uses BitBlt to capture the window. BitBlt (Windows 7 and up)
24    MethodBitBlt = libobs::window_capture_method_METHOD_BITBLT,
25    /// Uses Windows Graphics Capture to capture the window. Windows 10 (1903 and up)
26    MethodWgc = libobs::window_capture_method_METHOD_WGC,
27}
28
29#[repr(i32)]
30#[derive(Clone, Copy, Debug, PartialEq, Eq, FromPrimitive, ToPrimitive)]
31/// Describes the capture method of the monitor capture source.
32/// Used in `MonitorCaptureSourceBuilder`
33pub enum ObsDisplayCaptureMethod {
34    /// Automatically selects the best method based on the monitor.
35    MethodAuto = libobs::display_capture_method_DISPLAY_METHOD_AUTO,
36    /// Uses DXGI to capture the monitor.
37    MethodDXGI = libobs::display_capture_method_DISPLAY_METHOD_DXGI,
38    /// Uses Windows Graphics Capture to capture the monitor.
39    MethodWgc = libobs::display_capture_method_DISPLAY_METHOD_WGC,
40}
41
42#[repr(i32)]
43#[derive(Clone, Copy, Debug, PartialEq, Eq, FromPrimitive, ToPrimitive)]
44/// Describes the capture method of the window capture source.
45/// Used in `WindowCaptureSourceBuilder`
46pub enum ObsHookRate {
47    Slow = libobs::hook_rate_HOOK_RATE_SLOW,
48    Normal = libobs::hook_rate_HOOK_RATE_NORMAL,
49    Fast = libobs::hook_rate_HOOK_RATE_FAST,
50    Fastest = libobs::hook_rate_HOOK_RATE_FASTEST,
51}